<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-1189118158628153561</atom:id><lastBuildDate>Fri, 25 Oct 2024 11:17:35 +0000</lastBuildDate><category>Download Codes</category><category>FAQS</category><category>Certification</category><category>Webservices</category><title>JSP/Servlet Programmers and Coders</title><description>This Blog motive is to try its best to provide Source Codes and other related material to Java Programmers and Coders. This also provides Books download for the material like Java, Servlet, JSP, J2EE, RMI, JMS, EJB, JDBC, XML, XSL, CSS, Struts, Spring, AJAX, JavaScript and WebServices including their Tutorials.</description><link>http://coders-and-programmers-js.blogspot.com/</link><managingEditor>noreply@blogger.com (Ravinderjeet S. Nagpal)</managingEditor><generator>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-1024409687360859500</guid><pubDate>Fri, 18 Sep 2009 13:29:00 +0000</pubDate><atom:updated>2009-09-18T06:29:10.758-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Webservices</category><title>java.lang.reflect.InvocationTargetException on Tomcat 6.x/Axis1.4</title><description>I devloped the webservice using Apache Axis 1.4 an deployed it on Tomcat 6.x and it was giving some target invocation exception, below mentioned is a part of exception stacktrace while consuming it&lt;img smilieid="20" class="inlineimg" src="http://localhost:8081/GoogleContactsApi/sup_msgbody/11.bmp" border="0"&gt;&lt;br&gt;&lt;br&gt;&lt;pre style="margin: 0em;"&gt;java.lang.reflect.InvocationTargetException&lt;br&gt;   at org.apache.axis.message.SOAPFaultBuilder.createFault(&lt;br&gt;SOAPFaultBuilder.java:222)&lt;br&gt;   at org.apache.axis.message.SOAPFaultBuilder.endElement(&lt;br&gt;SOAPFaultBuilder.java:129)&lt;br&gt;   at org.apache.axis.encoding.DeserializationContext.endElement(&lt;br&gt;DeserializationContext.java:1087)&lt;br&gt;   at&lt;br&gt;com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown&lt;br&gt;Source)&lt;br&gt;   at&lt;br&gt;com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown&lt;br&gt;Source)&lt;br&gt;&lt;br&gt;-----------------------------&lt;font face="Arial Black" size="5"&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;/font&gt;-------------------------------------&lt;br&gt;&lt;/pre&gt;&lt;div align="center"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&lt;/div&gt;Then I thought &lt;img smilieid="18" class="inlineimg" src="http://localhost:8081/GoogleContactsApi/sup_msgbody/33.gif" border="0"&gt;&amp;nbsp; to search for its solution ut its was vey hectic multiple solutions but no outcome i become drizy &lt;img smilieid="17" class="inlineimg" src="http://localhost:8081/GoogleContactsApi/sup_msgbody/56.gif" border="0"&gt; but at last i got solution.&lt;br&gt;&lt;br&gt;The things were simple, i included multiple jar files needed for axis enviornment.&amp;nbsp; I included them in my classpath and also put them in my Tomcat lib folder.&lt;br&gt;&lt;br&gt;So i remove the axis jars from tomcat/lib but it gives me more exception. &lt;br&gt;&lt;br&gt;Then, I removed them from classpath and put them in Apache Tomcat /lib folder.&lt;br&gt;&lt;br&gt;And, Finally, My problem was solved. Actually, Tomcat needs Axis runtime enviornment to deploy webservice. &lt;br&gt;&lt;br&gt;Thanks to the links I refer &lt;img smilieid="14" class="inlineimg" src="sup_msgbody/59.gif" border="0"&gt;&lt;br&gt;&amp;nbsp;link are &lt;a href="http://www.mail-archive.com/users@tomcat.apache.org/msg13788.html"&gt;here&lt;/a&gt;. &lt;br&gt;&lt;br&gt;Hope this post able to solve your problem, if any. &lt;img smilieid="16" class="inlineimg" src="http://localhost:8081/GoogleContactsApi/sup_msgbody/35.gif" border="0"&gt;&lt;br&gt;&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Bookmark this page&lt;/b&gt;&lt;a title="Bookmark this site" href="http://del.icio.us/post?url=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html&amp;title=java.lang.reflect.InvocationTargetException on Tomcat 6.x/Axis1.4&gt;&lt;img border="0" alt="Bookmark this site" src="http://faqsonjava.googlepages.com/delicious.png"/&gt;&lt;/a&gt;&lt;a title="Digg this site" href="http://digg.com/submit?phase=3&amp;url=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html&amp;title=java.lang.reflect.InvocationTargetException on Tomcat 6.x/Axis1.4"&gt;&lt;img border="0" alt="Digg this site" src="http://faqsonjava.googlepages.com/digg.png"/&gt;&lt;/a&gt;&lt;a href="http://www.furl.net/store?s=f&amp;to=0&amp;u=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img border="0" alt="" src="http://faqsonjava.googlepages.com/furl.gif"/&gt;&lt;/a&gt;&lt;a href="http://www.netscape.com/submit/?U=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img border="0" alt="" src="http://faqsonjava.googlepages.com/netscape.png"/&gt;&lt;/a&gt;&lt;a href="http://www.stumbleupon.com/submit?url=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img border="0" alt="" src="http://faqsonjava.googlepages.com/stumble1.gif"/&gt;&lt;/a&gt;&lt;a href="http://technorati.com/faves?add=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img border="0" alt="" src="http://faqsonjava.googlepages.com/technorati.png"/&gt;&lt;/a&gt;&lt;a href="http://www.squidoo.com/lensmaster/bookmark?http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img border="0" alt="" src="http://faqsonjava.googlepages.com/squidoo.png"/&gt;&lt;/a&gt;&lt;a href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;mkt=en-us&amp;url=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img border="0" alt="" src="http://faqsonjava.googlepages.com/live.png"/&gt;&lt;/a&gt;&lt;a href="http://myweb.yahoo.com/myresults/bookmarklet?u=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img border="0" alt="" src="http://faqsonjava.googlepages.com/yahoo.png"/&gt;&lt;/a&gt;&lt;a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img border="0" alt="" src="http://faqsonjava.googlepages.com/google.png"/&gt;&lt;/a&gt;&lt;a href="http://www.facebook.com/sharer.php?u=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img border="0" alt="" src="http://faqsonjava.googlepages.com/facebook.gif"/&gt;&lt;/a&gt;&lt;a title="Save to simpy" href="http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img width="16" height="16" border="0" alt="simpy" src="http://faqsonjava.googlepages.com/simpy-icon-16x16.png"/&gt;&lt;/a&gt;&lt;a title="Submit to slashdot" href="http://slashdot.org/bookmark.pl?url=http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html"&gt;&lt;img width="13" height="13" border="0" alt="slashdot" src="http://faqsonjava.googlepages.com/slashdot-13x13.png"/&gt;&lt;/a&gt;&amp;nbsp;&lt;a title="Email this post" href="http://www.blogger.com/email-post.g?blogID=1189118158628153561&amp;postID=1024409687360859500"&gt;&lt;img border="0" alt="Email this post" src="http://www.blogger.com/img/icon18_email.gif"/&gt;&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/09/javalangreflectinvocationtargetexceptio.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-3289673249278184015</guid><pubDate>Thu, 05 Feb 2009 11:34:00 +0000</pubDate><atom:updated>2009-07-27T09:37:12.715-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title/><description>&lt;a class="normal12bluebold" href="http://www.ziddu.com/download/3204921/validate-XMLfromschemasandDtdswithexamples.zip.html"&gt;&lt;span style="font-weight:bold;"&gt;Download    xml Schema validation&lt;/span&gt;&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/02/download-validating-schema-code.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-3412406845290573008</guid><pubDate>Thu, 05 Feb 2009 11:30:00 +0000</pubDate><atom:updated>2009-07-27T09:41:14.068-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Certification</category><category domain="http://www.blogger.com/atom/ns#">FAQS</category><title>Download SCBCD Certification Notes (Tips &amp; Tricks)</title><description>htt&lt;a class="normal12bluebold" href="http://www.ziddu.com/download/3314639/SCBCDBETAEXAMTRICKSANDQUICKREVIEWS.doc.html" linkindex="35" set="yes"&gt;p://www.ziddu.com/download/3314639/SCBCDBETAEXAMTRICKSANDQUICKREVIEWS.doc.html&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/02/download-scbcd-certification-notes-tips.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-3401120707237862299</guid><pubDate>Thu, 05 Feb 2009 11:29:00 +0000</pubDate><atom:updated>2009-07-27T09:37:34.235-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download Struts and Ajax application</title><description>&lt;a class="normal12bluebold" href="http://www.ziddu.com/download/3325081/ajaxandstrutsapplication.zip.html"&gt;http://www.ziddu.com/download/3325081/ajaxandstrutsapplication.zip.html&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/02/download-struts-and-ajax-application.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-6966355983367340232</guid><pubDate>Thu, 05 Feb 2009 11:28:00 +0000</pubDate><atom:updated>2009-07-27T09:37:34.235-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download Tree Menu with Ajax</title><description>&lt;a class="normal12bluebold" href="http://www.ziddu.com/download/3325082/simple_tree_menu_with_ajax.zip.html"&gt;http://www.ziddu.com/download/3325082/simple_tree_menu_with_ajax.zip.html&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/02/download-tree-menu-with-ajax.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-5625745503818590723</guid><pubDate>Thu, 05 Feb 2009 11:26:00 +0000</pubDate><atom:updated>2009-07-27T09:37:34.235-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download Struts tiles example</title><description>&lt;a class="normal12bluebold" href="http://www.ziddu.com/download/3204984/StrutsTiles.zip.html"&gt;http://www.ziddu.com/download/3204984/StrutsTiles.zip.html&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/02/download-struts-tiles-example.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-7033168594304101595</guid><pubDate>Thu, 05 Feb 2009 11:24:00 +0000</pubDate><atom:updated>2009-07-27T09:37:34.236-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title/><description>&lt;a class="normal12bluebold" href="http://www.ziddu.com/download/3204052/DownloadFileInStruts.doc.html"&gt;&lt;span style="font-weight:bold;"&gt;DOWNLOAD STRUTS FILE DOWNLOAD EXAMPLE&lt;/span&gt;&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/02/download-struts-file-download-example.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-2947631331413664730</guid><pubDate>Thu, 05 Feb 2009 11:23:00 +0000</pubDate><atom:updated>2009-07-27T09:37:34.236-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download Struts Hibernate and Spring Code example</title><description>&lt;a class="normal12bluebold" href="http://www.ziddu.com/download/3325083/Struts_hibernate_Spring_code_Example.zip.html" linkindex="35" set="yes"&gt;http://www.ziddu.com/download/3325083/Struts_hibernate_Spring_code_Example.zip.html&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/02/download-struts-hibernate-and-spring.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-6345728221484548059</guid><pubDate>Thu, 05 Feb 2009 11:22:00 +0000</pubDate><atom:updated>2009-07-27T09:43:02.147-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">FAQS</category><title/><description>&lt;a class="normal12bluebold" href="http://www.ziddu.com/download/3325084/struts_hibernate_shopping-cart_code-Example.zip.html"&gt;Click here&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/02/shopping-cart-example-in-struts-and.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-3578028917989003875</guid><pubDate>Sun, 18 Jan 2009 13:49:00 +0000</pubDate><atom:updated>2009-07-27T09:36:31.507-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download Code for Swing Components</title><description>&lt;br clear="all"&gt;&amp;nbsp;&lt;a class="download" href="http://www.ziddu.com/download/3224828/swingdemos.rar.html"&gt;&lt;b&gt;http://www.ziddu.com/download/3224828/swingdemos.rar.html&lt;/b&gt;&lt;/a&gt;&lt;br&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/download-code-for-swing-components.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-5352507892497114193</guid><pubDate>Sun, 18 Jan 2009 13:46:00 +0000</pubDate><atom:updated>2009-07-27T09:36:31.507-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download Pagination code in JSP/Servlet</title><description>&lt;br clear="all"&gt;&lt;a class="download" href="http://www.ziddu.com/download/3224792/Pagination.rar.html"&gt;&lt;b&gt;http://www.ziddu.com/download/3224792/Pagination.rar.html&lt;/b&gt;&lt;/a&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/download-pagination-code-in-jspservlet.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-5499925061008570836</guid><pubDate>Sun, 18 Jan 2009 13:40:00 +0000</pubDate><atom:updated>2009-07-27T09:36:31.507-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download Struts-AJAX CRUD, Download CRUD in Struts/Ajax</title><description>&lt;a class="download" href="http://www.ziddu.com/download/3224732/struts-ajax-crud.zip.html"&gt;&lt;b&gt;http://www.ziddu.com/download/3224732/struts-ajax-crud.zip.html&lt;/b&gt;&lt;/a&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/download-struts-ajax-crud-download-crud.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-615188347171205771</guid><pubDate>Sun, 18 Jan 2009 13:34:00 +0000</pubDate><atom:updated>2009-07-27T09:36:31.508-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download JSP/Servlet Project for maintainig Events/ Download Event management Project in JSP/SERVLET</title><description>&lt;a class="download" href="http://www.ziddu.com/download/3224682/events_jsp.zip.html"&gt;&lt;b&gt;http://www.ziddu.com/download/3224682/events_jsp.zip.html&lt;/b&gt;&lt;/a&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/download-jspservlet-project-for_18.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-6631533856871412592</guid><pubDate>Sun, 18 Jan 2009 13:26:00 +0000</pubDate><atom:updated>2009-07-27T09:36:31.508-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download JSP/Servlet Project for Mainataining Employee Directory</title><description>&lt;br clear="all"&gt;&lt;a class="download" href="http://www.ziddu.com/download/3224571/empldir_jsp.zip.html"&gt;&lt;b&gt;http://www.ziddu.com/download/3224571/empldir_jsp.zip.html&lt;/b&gt;&lt;/a&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/download-jspservlet-project-for.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-7645052781939473671</guid><pubDate>Sun, 18 Jan 2009 13:24:00 +0000</pubDate><atom:updated>2009-07-27T09:36:31.508-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download Sample JSP/Servlet project for Classifieds</title><description>&amp;nbsp;&lt;a class="download" href="http://www.ziddu.com/download/3224553/classifieds_jsp.zip.html"&gt;&lt;b&gt;http://www.ziddu.com/download/3224553/classifieds_jsp.zip.html&lt;/b&gt;&lt;/a&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/download-sample-jspservlet-project-for.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-4712501190960720687</guid><pubDate>Sun, 18 Jan 2009 13:22:00 +0000</pubDate><atom:updated>2009-07-27T09:36:31.508-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download Sample Bug Tracking System in JSP/Servlet</title><description>&amp;nbsp;&lt;a class="download" href="http://www.ziddu.com/download/3224533/bugtrack_jsp.zip.html"&gt;&lt;b&gt;http://www.ziddu.com/download/3224533/bugtrack_jsp.zip.html&lt;/b&gt;&lt;/a&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/download-sample-bug-tracking-system-in.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-3377247400316325124</guid><pubDate>Sun, 18 Jan 2009 13:20:00 +0000</pubDate><atom:updated>2009-07-27T09:36:31.509-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download BookStore Project in JSP/Servlet with its Database, Download JSP/Servlet Project for BookStore</title><description>&lt;a class="download" href="http://www.ziddu.com/download/3224502/bookstore_jsp.zip.html"&gt;&lt;b&gt;http://www.ziddu.com/download/3224502/bookstore_jsp.zip.html&lt;/b&gt;&lt;/a&gt;&lt;a class="download" href="http://www.ziddu.com/download/3224502/bookstore_jsp.zip.html"&gt;&lt;b&gt;http://www.ziddu.com/download/3224502/bookstore_jsp.zip.html&lt;/b&gt;&lt;/a&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/download-bookstore-project-in.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-4816198444169537035</guid><pubDate>Fri, 16 Jan 2009 13:47:00 +0000</pubDate><atom:updated>2009-07-27T09:36:31.509-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download 3000 JavaScript Codes Free, Free download javascript codes, 3000 javascript downloads for free.</title><description>&lt;span class="tahoma12bold"&gt;&lt;a class="download" href="http://www.ziddu.com/download/3204709/javascriptcodes.rar.html"&gt;&lt;b&gt;http://www.ziddu.com/download/3204709/javascriptcodes.rar.html&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/download-3000-javascript-codes-free.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-7911610424565239287</guid><pubDate>Fri, 16 Jan 2009 11:14:00 +0000</pubDate><atom:updated>2009-07-27T09:36:31.509-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Download Code for Using Ajax with Struts1.2.9, Ajax and struts, Ajax with Struts</title><description>&lt;strong&gt;&lt;font style="BACKGROUND-COLOR: #ffffff" color="#000066" size="4"&gt;&lt;em&gt;&lt;u&gt;Link to Download &lt;/u&gt;-----&lt;/em&gt;&lt;/font&gt;&lt;/strong&gt;&amp;nbsp;&lt;a href="http://www.ziddu.com/download/3203595/AjaxusingXMLHttpRequestandStruts.rar.html" target="_blank"&gt;&lt;b&gt;http://www.ziddu.com/download/3203595/AjaxusingXMLHttpRequestandStruts.rar.html&lt;/b&gt;&lt;/a&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/download-code-for-using-ajax-with.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-5033297042066096351</guid><pubDate>Wed, 14 Jan 2009 07:15:00 +0000</pubDate><atom:updated>2009-07-27T09:42:06.820-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">FAQS</category><title>Struts 2: Validation</title><description>&lt;a href="http://java-x.blogspot.com/2006/11/struts-2-validation.html"&gt;Struts 2: Validation&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/01/abhi-on-java-struts-2-validation.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-8238895901046536120</guid><pubDate>Sat, 10 Jan 2009 08:38:00 +0000</pubDate><atom:updated>2009-07-27T09:41:14.069-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">FAQS</category><title>Traditional CGI and Servlet</title><description>&lt;img src="file:///E:/DOCUME%7E1/Admin/LOCALS%7E1/Temp/moz-screenshot.jpg" alt=""&gt;&lt;img src="file:///E:/DOCUME%7E1/Admin/LOCALS%7E1/Temp/moz-screenshot-1.jpg" alt=""&gt;&lt;p&gt;&amp;#32;       &lt;!--6--&gt;&lt;hr size=1&gt;&lt;/hr&gt; Add more friends to your messenger and enjoy! &lt;a href="http://in.rd.yahoo.com/tagline_messenger_6/*http://messenger.yahoo.com/invite/"&gt; Invite them now.&lt;/a&gt;</description><link>http://coders-and-programmers-js.blogspot.com/2009/01/traditional-cgi-and-servlet.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-3081692668990523924</guid><pubDate>Sat, 10 Jan 2009 06:43:00 +0000</pubDate><atom:updated>2009-07-27T09:42:48.327-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Java class/code used in extracting the thumbnail from the image.</title><description>&lt;u&gt;&lt;b&gt;Java class/code used in extracting the thumbnail from the image.&lt;/b&gt;&lt;/u&gt;&lt;br&gt;&lt;br&gt;public class ImageClass {&lt;br&gt;&lt;br&gt;public static void main(String[] args) throws Exception {&lt;br&gt;&lt;br&gt;// load image from INFILE&lt;br&gt;Image image = Toolkit.getDefaultToolkit().getImage(args[0]);&lt;br&gt; &lt;br&gt;MediaTracker mediaTracker = new MediaTracker(new Container());&lt;br&gt;&lt;br&gt;mediaTracker.addImage(image, 0);&lt;br&gt;&lt;br&gt;mediaTracker.waitForID(0);&lt;br&gt;&lt;br&gt;// determine thumbnail size from WIDTH and HEIGHT&lt;br&gt;&lt;br&gt;int thumbWidth = 120;&lt;br&gt; int thumbHeight =80;&lt;br&gt;&lt;br&gt;System.out.println(&amp;quot; thumb Width = &amp;quot;+ thumbWidth + &amp;quot; thumb Height = &amp;quot;+thumbHeight);&lt;br&gt;&lt;br&gt;int imageWidth = image.getWidth(null);&lt;br&gt;&lt;br&gt;int imageHeight = image.getHeight(null);&lt;br&gt; &lt;br&gt;String outputFile = args[1];&lt;br&gt;&lt;br&gt;String quality = 75;&lt;br&gt;&lt;br&gt;System.out.println(&amp;quot;imageWidth &amp;quot; +imageHeight);&lt;br&gt;&lt;br&gt;System.out.println(&amp;quot;imageHeight &amp;quot; +imageWidth);&lt;br&gt;&lt;br&gt;byte[] bytes = imageSizer(imageWidth,imageHeight,thumbWidth,thumbHeight,image,outputFile,quality);&lt;br&gt; &lt;br&gt;&lt;br&gt;Image image1= Toolkit.getDefaultToolkit().createImage(bytes);&lt;br&gt;&lt;br&gt;BufferedImage bi = convert(image1);&lt;br&gt;&lt;br&gt;File file1 = new File(&amp;quot;c:\\byteImage.jpg&amp;quot;);&lt;br&gt;&lt;br&gt;BufferedOutputStream out;&lt;br&gt;try {&lt;br&gt;&lt;br&gt; out = new BufferedOutputStream(new&lt;br&gt;&lt;br&gt;FileOutputStream(file1));&lt;br&gt;&lt;br&gt;out.write(bytes);&lt;br&gt;&lt;br&gt;out.flush();&lt;br&gt;&lt;br&gt;out.close();&lt;br&gt;&lt;br&gt;}&lt;br&gt;catch(Exception e)&lt;br&gt;{&lt;br&gt;e.printStackTrace();&lt;br&gt;}&lt;br&gt;&lt;br&gt;System.out.println(&amp;quot;Done.&amp;quot;);&lt;br&gt; &lt;br&gt;System.exit(0);&lt;br&gt;&lt;br&gt;}&lt;br&gt;&lt;br&gt;private static byte[] imageSizer(int imageWidth,int imageHeight,int thumbWidth,int thumbHeight ,Image image,String outputFile,String qualityOfImage)&lt;br&gt;{&lt;br&gt;&lt;br&gt;&amp;nbsp; byte[] imageAsBytes = null;&lt;br&gt; &lt;br&gt;&amp;nbsp; for(int i = 0 ; i &amp;lt; 3 ; i++)&lt;br&gt;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double thumbRatio = (double)thumbWidth / (double)thumbHeight;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot; Image Width = &amp;quot;+ imageWidth + &amp;quot; Height = &amp;quot;+imageHeight);&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (i == 0)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double imageRatio = (double)imageWidth / (double)imageHeight;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;System.out.println(&amp;quot; Image Ratio&amp;quot;+imageRatio);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (thumbRatio &amp;lt; imageRatio) &lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thumbHeight = (int)(thumbWidth / imageRatio);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thumbWidth = (int)(thumbHeight * imageRatio);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if(i==2)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thumbWidth = imageWidth ;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;thumbHeight = imageHeight ;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp; else&lt;br&gt;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thumbWidth = thumbWidth * 2 ;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thumbHeight = thumbHeight * 2 ;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&lt;br&gt;System.out.println(&amp;quot; After Checking Ratio ::: thumb Width = &amp;quot;+ thumbWidth + &amp;quot; thumb Height = &amp;quot;+thumbHeight);&lt;br&gt; &lt;br&gt;// draw original image to thumbnail image object and&lt;br&gt;// scale it to the new size on-the-fly&lt;br&gt;&lt;br&gt;BufferedImage thumbImage = new BufferedImage(thumbWidth,&lt;br&gt;thumbHeight, BufferedImage.TYPE_INT_RGB);&lt;br&gt;&lt;br&gt;Graphics2D graphics2D = thumbImage.createGraphics();&lt;br&gt; &lt;br&gt;graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,&lt;br&gt;&lt;br&gt;RenderingHints.VALUE_INTERPOLATION_BILINEAR);&lt;br&gt;&lt;br&gt;graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);&lt;br&gt;&lt;br&gt;// save thumbnail image to OUTFILE&lt;br&gt; &lt;br&gt;BufferedOutputStream out;&lt;br&gt;try {&lt;br&gt;&lt;br&gt;out = new BufferedOutputStream(new&lt;br&gt;&lt;br&gt;FileOutputStream(outputFile+&amp;quot;_&amp;quot;+i+&amp;quot;.jpg&amp;quot;));&lt;br&gt;&lt;br&gt;&lt;br&gt;JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);&lt;br&gt; &lt;br&gt;JPEGEncodeParam param = encoder.&lt;br&gt;&lt;br&gt;getDefaultJPEGEncodeParam(thumbImage);&lt;br&gt;&lt;br&gt;int quality = Integer.parseInt(qualityOfImage);&lt;br&gt;&lt;br&gt;quality = Math.max(0, Math.min(quality, 100));&lt;br&gt;&lt;br&gt;param.setQuality((float)quality / 100.0f, false);&lt;br&gt; &lt;br&gt;encoder.setJPEGEncodeParam(param);&lt;br&gt;&lt;br&gt;encoder.encode(thumbImage);&lt;br&gt;&lt;br&gt;//Encoding it into a byte stream to store it in the database&lt;br&gt;File imageFile = new File(outputFile+&amp;quot;_&amp;quot;+i+&amp;quot;.jpg&amp;quot;);&lt;br&gt;&lt;br&gt; imageAsBytes = getBytesFromFile(imageFile);&lt;br&gt;&lt;br&gt;}&lt;br&gt;catch (FileNotFoundException e) &lt;br&gt;{&lt;br&gt;// TODO Auto-generated catch block&lt;br&gt;e.printStackTrace();&lt;br&gt;&lt;br&gt;} catch (ImageFormatException e1) &lt;br&gt;{&lt;br&gt;// TODO Auto-generated catch block&lt;br&gt; e1.printStackTrace();&lt;br&gt;&lt;br&gt;} catch (IOException e2) &lt;br&gt;{&lt;br&gt;// TODO Auto-generated catch block&lt;br&gt;e2.printStackTrace();&lt;br&gt;}&lt;br&gt;}//end of for loop&lt;br&gt;return imageAsBytes;&lt;br&gt;}&lt;br&gt;&lt;br&gt;/**&lt;br&gt;*&lt;br&gt;* @param im&lt;br&gt;* @return&lt;br&gt; */&lt;br&gt;public static BufferedImage convert(Image im)&lt;br&gt;{&lt;br&gt;int imgHeight=im.getHeight(null);&lt;br&gt;int imgWidth= im.getWidth(null) ;&lt;br&gt;BufferedImage bi = new BufferedImage( 1024 , 768 , BufferedImage.TYPE_INT_RGB);&lt;br&gt;Graphics bg = bi.getGraphics();&lt;br&gt; bg.drawImage(im, 0, 0, null);&lt;br&gt;bg.dispose();&lt;br&gt;return bi;&lt;br&gt;}&lt;br&gt;/**&lt;br&gt;* returns the byte array to the corresponding file&lt;br&gt;* @param file&lt;br&gt;* @return byte[]&lt;br&gt;* @throws IOException&lt;br&gt;*/&lt;br&gt;private static byte[] getBytesFromFile(File file) throws IOException &lt;br&gt; {&lt;br&gt;&lt;br&gt;InputStream is = new FileInputStream(file);&lt;br&gt;&lt;br&gt;ByteArrayOutputStream bytestream = new ByteArrayOutputStream();&lt;br&gt;&lt;br&gt;final int DEFAULT_BUFFER_SIZE = 1024 * 4;&lt;br&gt;&lt;br&gt;byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];&lt;br&gt; &lt;br&gt;int count = 0;&lt;br&gt;&lt;br&gt;int num = 0;&lt;br&gt;&lt;br&gt;while ((num = is.read(buffer)) != -1)&lt;br&gt;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp; bytestream.write(buffer, 0, num);&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; count += num;&lt;br&gt;&amp;nbsp;&amp;nbsp; }&lt;br&gt;return bytestream.toByteArray();&lt;br&gt;&amp;nbsp; }&lt;br&gt;&lt;br&gt;}&lt;br&gt;&amp;nbsp;&lt;br&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/java-classcode-used-in-extracting.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-3463383237884519162</guid><pubDate>Tue, 06 Jan 2009 09:01:00 +0000</pubDate><atom:updated>2009-07-27T09:41:14.069-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">FAQS</category><title>CONFIGURING SSL IN JAVA (SECURE SOCKET LAYER)</title><description>&lt;font color="#000099"&gt;&lt;u&gt;&lt;strong&gt;&amp;nbsp;CONFIGURING SSL IN JAVA (SECURE SOCKET LAYER)&lt;/strong&gt;&lt;/u&gt;&lt;/font&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;em class="western"&gt;One of the great things about the Java programming language is the Open Source community that provides great applications at little or no cost. An example of this is Apache Tomcat, which provides a solid Web server for development using servlet or JSP technology. Now that Web Service technology is maturing there&amp;#39;s a potential for a whole scenario of applications to take advantage of a Swing feature-rich thin client on the front-end coupled to the data verification and business logic already developed in the Web or ejb tier. Such applications are only viable if they can be secure, however, security doesn&amp;#39;t have to come at a great cost. The purpose of this article is to demonstrate how Web Service clients can use self-signed security certificates over the secure HTTPS protocol.&lt;/em&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;img height="127" hspace="4" src="http://gemsres.com/story/may06/216388/Web-Service-226.gif" width="226" align="right" vspace="8" border="0" name="graphics1"&gt;The Problem with Using Self-Signed Certificates&lt;br&gt; HTTPS typically works seamlessly with the non-secure HTTP protocol and doesn&amp;#39;t interrupt the user&amp;#39;s experience. This is because SSL certificates are designed to be verified and signed by a trusted third party. Verisign is a popular certificate authority. If a Web application requires secure communication, you can pay Verisign to sign your SSL certificate. Once Verisign does that, users on your Web site can switch between HTTP and HTTPS without interruption because all major Web browsers trust certificates signed by Verisign. Verisign is not the only option for getting certificates signed. To save operating costs, or for personal use, you can self-sign your own certificate. However, self-signing your certificate will interrupt your Web site user&amp;#39;s experience. Typically the Web browser will display a dialog box asking if you want to trust a certificate you signed.&lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;Web browsers are nice because when they get a certificate signed by an unknown certificate authority there&amp;#39;s an option to proceed. When developing Web Service clients for communication over HTTPS it&amp;#39;s not so easy. When running Java code there&amp;#39;s no dialog box asking about trusting a distrusted certificate authority. The JRE will throw an exception trying to connect over HTTPS to a Web site with a distrusted certificate: &lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;em class="western"&gt;Caused by: &lt;/em&gt;&lt;strong class="western"&gt;sun.security.validator.ValidatorException:&lt;/strong&gt;&lt;em class="western"&gt; No trusted certificate found&lt;/em&gt; &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;There&amp;#39;s no way to catch this exception and continue. To get the Web Service to work with a self-signed certificate the JRE has to somehow trust you as a certificate authority. &lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;Solution Outline&lt;/strong&gt;&lt;br&gt;To demonstrate a solution to this problem I&amp;#39;ll do the following:&lt;/font&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;Generate and self-sign my own certificate &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;Configure Tomcat for SSL and make it use that certificate &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;Create an example Web Service to be called over HTTPS &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;Generate Web Service client code from WSDL &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;Demonstrate a client using a custom keystore solution &lt;/font&gt;&lt;/p&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;Generating a Self-Signed Certificate&lt;/strong&gt;&lt;br&gt;The JDK comes with a tool, keytool.exe, that is used to mange SSL public/private keys. Keys are added and removed from a binary file on the file system. The default keystore file is JAVA_HOME\jre\lib\security\cacerts. This file contains the list of certificate authorities that the JRE will trust. A list of well-known trusted companies like Verisign is already in the keystore. To see this list, execute with password &amp;quot;changeit&amp;quot;: &lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;D:\&amp;gt;keytool -list -rfc -keystore JAVA_HOME\jre\lib\security\cacerts &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;The keytool application can be used to edit this file. However, just in case something goes wrong it&amp;#39;s better to create a new file. If keytool isn&amp;#39;t told which file to use it creates HOME/.keystore by default.&lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;To generate your own self-signed certificate execute: &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;D:\&amp;gt;keytool.exe -genkey -alias Tomcat -keyalg RSA -storepass bigsecret -keypass bigsecret -dname &amp;quot;cn=localhost&amp;quot; &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;After executing this command there will be a .keystore file in your HOME directory. Here&amp;#39;s what the switches mean.&lt;/font&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;genkey:&lt;/strong&gt; Tells the keytool applica-tion to generate new public/private key pair. &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;&lt;em class="western"&gt;alias:&lt;/em&gt; The name used to refer to the keys. Remember, the .keystore file can contain many keys. &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;keyalg:&lt;/strong&gt; Generates public/private keys using the RSA algorithm. &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;storepass:&lt;/strong&gt; What password is needed to access the .keystore file. &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;&lt;em class="western"&gt;keypass:&lt;/em&gt; What password is needed to manage the keys. &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;dname:&lt;/strong&gt; This value is very important. I used &amp;quot;localhost&amp;quot; because this example is designed to run locally. If a Web application is registered as &lt;em class="western"&gt;&lt;a href="http://www.myserver.com"&gt;http://www.myserver.com&lt;/a&gt;&lt;/em&gt; then this value must be &lt;em class="western"&gt;&lt;a href="http://www.myserver.com"&gt;www.myserver.com&lt;/a&gt;&lt;/em&gt;. If the names don&amp;#39;t match the certificate will automatically be rejected. &lt;/font&gt;&lt;/p&gt; &lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;Once the keytool application creates a new public/private key pair it automatically self-signs the key. You have just generated your own self-signed certificate, which can be used for HTTPS communications. You only need to extract the self-signed public key. I&amp;#39;ll show how to do this later. &lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;Configuring Tomcat for SSL&lt;/strong&gt;&lt;br&gt;Now you have to configure Tomcat to use your self-signed certificate. I used Tomcat 5.0.30. Edit the TOMCAT/conf/server.xml file. Search the file for &amp;quot;8443&amp;quot; and uncomment the &amp;lt;Connector.../&amp;gt; bound to that port. Then you&amp;#39;ll have to add the following property to the &amp;lt;Connector.../&amp;gt;: &lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;keystorePass=&amp;quot;bigsecret&amp;quot; &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;When the JRE starts, it will automatically find the HOME/.keystore file and Tomcat will try to access it using the password &amp;quot;bigsecret.&amp;quot; When Tomcat starts there should be output to the console that looks similar to: &lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;Feb 4, 2006 3:11:23 PM org.apache.coyote.http11.Http11Protocol start&lt;br&gt;INFO: Starting Coyote HTTP/1.1 on http-8443 &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;This means the &amp;lt;Connector.../&amp;gt; successfully read the .keystore file and you can now do secure HTTPS connections over the 8443 port. Open a Web browser and try &lt;em class="western"&gt;&lt;a href="https://localhost:8443/"&gt;https://localhost:8443/&lt;/a&gt;&lt;/em&gt;. Because the certificate is self-signed the Web browser will display a dialog box asking about trusting the connection. If accepted, all communications will be secure over HTTPS. &lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;Creating the Web Service&lt;/strong&gt;&lt;br&gt;I&amp;#39;m going to use the Apache Axis project to create a very simple Web Service. The Web Service will simulate checking for new e-mail messages. A Web Service client passes a token uniquely identifying a user. The Web Service returns a list of new e-mail messages (&lt;u&gt;see Listing 1&lt;/u&gt;).&lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;To get the Web Service deployed, follow these steps:&lt;/font&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;Cut and paste the code from Listing 1 into a file named Email.jws in Webapp&amp;#39;s root directory. &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;Edit the Web.xml file, adding the Axis servlet and a *.jws mapping (Listing 2). &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;Put the Axis jar files in WEB-INF/lib. See References at the end of this article for the Axis project URL. &lt;/font&gt;&lt;/p&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;After deploying this article&amp;#39;s accompanying WAR file (and configuring Tomcat for SSL), the Web Service is accessible securely over HTTPS at the following URL: &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;em class="western"&gt;&lt;a href="https://localhost:8443/JDJArticleWebService/Email.jws"&gt;https://localhost:8443/JDJArticleWebService/Email.jws&lt;/a&gt;&lt;/em&gt; &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;Using WSDL2Java&lt;/strong&gt;&lt;br&gt;The Axis project provides a tool named WSDL2Java that takes a Web Service WSDL and automatically create the Java source code needed to use the Web Service. See Listing 3 for the command line used to generate code for the Email.jws Web Service.&lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;Notice the URL in Listing 3 used to access the WSDL. It&amp;#39;s the non-secure HTTP protocol over port 8080. Why not use HTTPS over port 8443? Because of the self-signed certificate, the WSDL2Java tool will encounter the same exact certificate problem this article is trying to provide a solution for. So for now the non-secure protocol must be used. This means the generated code must be altered slightly replacing &amp;quot;http&amp;quot; and &amp;quot;8080&amp;quot; references with &amp;quot;https&amp;quot; and &amp;quot;8443.&amp;quot; This article&amp;#39;s accompanying client zip file contains the altered code. &lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;Client with a Custom Keystore&lt;/strong&gt;&lt;br&gt;The JRE&amp;#39;s default keystore is JAVA_HOME\jre\lib\security\cacerts. Java applications will throw an exception whenever they are presented with your self-signed certificate because your certificate isn&amp;#39;t in this keystore. Therefore, when developing a client there are two options. The first option is to put your self-signed certificate into the JRE&amp;#39;s default keystore. Although this would work it&amp;#39;s not a very good solution because customization is required on every client machine. The second option is to generate a custom keystore, put your self-signed certificate into it, and distribute the custom keystore as part of your application (typically inside a jar file).&lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;To create a custom keystore for your client the following has to be done:&lt;/font&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt; &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;Export the self-signed public key from HOME/.keystore. &lt;/font&gt;&lt;/p&gt; &lt;li&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;Import the self-signed public key into a new keystore for you client. &lt;/font&gt;&lt;/p&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;To export the self-signed public key from HOME/.keystore execute the following: &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;D:\&amp;gt;keytool.exe -export -rfc -alias Tomcat -file Tomcat.cer -storepass bigsecret -keypass bigsecret &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;Now create the custom keystore for the client by importing Tomcat.cer: &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;D:&amp;gt;keytool.exe -import -noprompt -trustcacerts -alias Tomcat -file Tomcat.cer -keystore CustomKeystore -storepass littlesecret &lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;Using the switch &amp;quot;-keystore CustomKeystore&amp;quot; will create a new keystore file called &amp;quot;CustomKeystore&amp;quot; in the present working directory. You&amp;#39;ll find the CustomKeystore file in the /classpath/resources/keystore directory of this article&amp;#39;s client zip file. Replace this one with the file just generated.&lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;Now all that&amp;#39;s left to do is to create a client that uses this custom keystore. I&amp;#39;ll demonstrate two ways to do this.&lt;/font&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;font color="#000099"&gt;The first is to use the Java system properties javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword to point to the CustomKeystore file and provide the password to access it. My example Web Service client in the jdj.wsclient.truststore package takes this approach (see Listing 4). The main() method sets the system properties then creates the objects to use the Web Service. When the JRE needs to access a keystore it looks for the &amp;quot;classpath/resources/keystore/CustomKeystore&amp;quot; file on the file system. Although this is a simple solution it&amp;#39;s problematic because the keystore file must be on the file system and the client code must know where to look for it.&lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;The second is a more portable solution that keeps resources inside the jar file and avoids the file system issues. The client code is responsible for reading the CustomKeystore file and somehow using it to create a secure connection to the server. My example Web Service client in the jdj.wsclient.socketfactory package takes this approach (see Listing 5). Listing 5 shows how to read the CustomKeystore file as a resource and use it to create a javax.net.ssl.SSLSocketFactory. Configuring the Axis pluggable architecture, the MySocketFactory class can be then used to create secure Socket objects from this factory. &lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;font color="#000099"&gt;&lt;strong class="western"&gt;Conclusion&lt;/strong&gt;&lt;br&gt;This article started with a simple problem: I wanted to secure Web Service communications over HTTPS using my own self-signed certificates. By default, the JRE will reject my application&amp;#39;s self-signed certificate because I am not a trusted certificate authority. To get secure communications to work I had to get the Web Service client JRE to trust my self-signed certificate. To achieve this, I used the keytool application and generated a new public/private key pair, extracted the self-signed public key, and then created a new keystore and imported this self-signed certificate. I then created a totally self-contained Web Service client that doesn&amp;#39;t require any client-side configuration. &lt;/font&gt;&lt;/p&gt;  &lt;p style="MARGIN-BOTTOM: 0in" align="justify"&gt;&lt;font color="#000099"&gt;&lt;br&gt;&lt;/font&gt;&lt;/p&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/configuring-ssl-in-java-secure-socket.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-353176581896573355</guid><pubDate>Tue, 06 Jan 2009 08:59:00 +0000</pubDate><atom:updated>2009-07-27T09:42:48.327-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>"javax.activation.UnsupportedDataTypeException: no object DCH for MIME type xxx/xxxx javax.mail.MessagingException: IOException while sending message;</title><description>&lt;span style="COLOR: rgb(0,0,102); BACKGROUND-COLOR: rgb(255,255,255)"&gt;&lt;strong&gt;&lt;font face="Verdana"&gt;&lt;u&gt;javax.activation.UnsupportedDataTypeException: no object DCH for MIME type xxx/xxxx javax.mail.MessagingException: IOException while sending message;&lt;/u&gt;&lt;br&gt; &lt;br&gt;&lt;br style="COLOR: rgb(51,51,153)"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;font style="COLOR: rgb(51,51,153)" face="Verdana,Arial,Helvetica" size="2"&gt;I was using a custom Java wrapper class I developed for the background processing of emails from Java apps when I encountered these issues with unhandled MIME types, specifically &amp;quot;text/html&amp;quot; and &amp;quot;multipart/*&amp;quot;. &lt;br&gt; &lt;br&gt;For me, the initial solution was (as suggested in this forum at the outset) providing for these types via the mailcap file (either external or located in the META-INF folder of the distribution jar). However, I subsequently ended up adding the following lines to my email wrapper class:&lt;br&gt; &lt;br&gt;&lt;tt&gt;// add handlers for main MIME types&lt;br&gt;MailcapCommandMap mc = (MailcapCommandMap)CommandMap.getDefaultCommandMap();&lt;br&gt;mc.addMailcap(&amp;quot;text/html;; x-java-content-handler=com.sun.mail.handlers.text_html&amp;quot;);&lt;br&gt; mc.addMailcap(&amp;quot;text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml&amp;quot;);&lt;br&gt;mc.addMailcap(&amp;quot;text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain&amp;quot;);&lt;br&gt;mc.addMailcap(&amp;quot;multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed&amp;quot;);&lt;br&gt; mc.addMailcap(&amp;quot;message/rfc822;; x-java-content-handler=com.sun.mail.handlers.message_rfc822&amp;quot;);&lt;br&gt;CommandMap.setDefaultCommandMap(mc);&lt;br&gt;&lt;/tt&gt;&lt;br&gt;&lt;br&gt;This works fine, and keeps all the relevant dependencies in one place, so I know it will always work irrespective of the overall Java app configuration. Another reason was speed, as the following excerpt from the relevant javadoc proves:&lt;br&gt; &lt;br&gt;(&lt;a href="http://java.sun.com/j2ee/1.4/docs/api/javax/activation/MailcapCommandMap.html"&gt;http://java.sun.com/j2ee/1.4/docs/api/javax/activation/MailcapCommandMap.html&lt;/a&gt;)&lt;br&gt;&lt;br&gt;&lt;i&gt;The MailcapCommandMap looks in various places in the user&amp;#39;s system for mailcap file entries. When requests are made to search for commands in the MailcapCommandMap, it searches mailcap files in the following order: &lt;br&gt; &lt;br&gt;1) Programatically added entries to the MailcapCommandMap instance. &lt;br&gt;2) The file .mailcap in the user&amp;#39;s home directory. &lt;br&gt;3) The file &amp;lt;java.home&amp;gt;/lib/mailcap. &lt;br&gt;4) The file or resources named META-INF/mailcap. &lt;br&gt; 5) The file or resource named META-INF/mailcap.default (usually found only in the activation.jar file).&lt;/i&gt;&lt;/font&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2009/01/javaxactivationunsupporteddatatypeexcep.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1189118158628153561.post-8472249467061726159</guid><pubDate>Wed, 31 Dec 2008 11:28:00 +0000</pubDate><atom:updated>2009-07-27T09:42:48.328-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Download Codes</category><title>Code for creating and writing to a Excel Sheet</title><description>&lt;font size="2"&gt; &lt;p&gt;JExcel API provides various classes to create, read, write data to Excel documents at runtime. The required platform is JVM which means the code developed with JExcel can be run on Windows and Linux without any modification.&lt;/p&gt;  &lt;p&gt;The example below creates a new document and writes data into different sheets of the new Excel document.&lt;/p&gt; &lt;p&gt;import java.io.*;&lt;/p&gt; &lt;p&gt;import jxl.*;&lt;/p&gt; &lt;p&gt;import java.util.*;&lt;/p&gt; &lt;p&gt;import jxl.Workbook;&lt;/p&gt; &lt;p&gt;import jxl.write.DateFormat;&lt;/p&gt; &lt;p&gt;import jxl.write.Number;&lt;/p&gt; &lt;p&gt;import jxl.write.*;&lt;/p&gt; &lt;p&gt;import java.text.SimpleDateFormat;&lt;/p&gt; &lt;p&gt;class create&lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;p&gt;public static void main(String[] args) &lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;p&gt;try&lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;p&gt;String filename = &amp;quot;input.xls&amp;quot;;&lt;/p&gt; &lt;p&gt;WorkbookSettings ws = new WorkbookSettings();&lt;/p&gt; &lt;p&gt;ws.setLocale(new Locale(&amp;quot;en&amp;quot;, &amp;quot;EN&amp;quot;));&lt;/p&gt; &lt;p&gt;WritableWorkbook workbook = &lt;/p&gt; &lt;p&gt;Workbook.createWorkbook(new File(filename), ws);&lt;/p&gt; &lt;p&gt;WritableSheet s = workbook.createSheet(&amp;quot;Sheet1&amp;quot;, 0);&lt;/p&gt; &lt;p&gt;WritableSheet s1 = workbook.createSheet(&amp;quot;Sheet1&amp;quot;, 0);&lt;/p&gt; &lt;p&gt;writeDataSheet(s);&lt;/p&gt; &lt;p&gt;writeImageSheet(s1);&lt;/p&gt; &lt;p&gt;workbook.write();&lt;/p&gt; &lt;p&gt;workbook.close(); &lt;/p&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;catch (IOException e)&lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;p&gt;e.printStackTrace();&lt;/p&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;catch (WriteException e)&lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;p&gt;e.printStackTrace();&lt;/p&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;private static void writeDataSheet(WritableSheet s) &lt;/p&gt; &lt;p&gt;throws WriteException&lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;p&gt;/* Format the Font */&lt;/p&gt; &lt;p&gt;WritableFont wf = new WritableFont(WritableFont.ARIAL, &lt;/p&gt; &lt;p&gt;10, WritableFont.BOLD);&lt;/p&gt; &lt;p&gt;WritableCellFormat cf = new WritableCellFormat(wf);&lt;/p&gt; &lt;p&gt;cf.setWrap(true);&lt;/p&gt; &lt;p&gt;/* Creates Label and writes date to one cell of sheet*/&lt;/p&gt; &lt;p&gt;Label l = new Label(0,0,&amp;quot;Date&amp;quot;,cf);&lt;/p&gt; &lt;p&gt;s.addCell(l);&lt;/p&gt; &lt;p&gt;WritableCellFormat cf1 = &lt;/p&gt; &lt;p&gt;new WritableCellFormat(DateFormats.FORMAT9);&lt;/p&gt; &lt;p&gt;DateTime dt = &lt;/p&gt; &lt;p&gt;new DateTime(0,1,new Date(), cf1, DateTime.GMT);&lt;/p&gt; &lt;p&gt;s.adCell(dt);&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;/* Creates Label and writes float number to one cell of sheet*/&lt;/p&gt; &lt;p&gt;l = new Label(2,0,&amp;quot;Float&amp;quot;, cf);&lt;/p&gt; &lt;p&gt;s.addCell(l);&lt;/p&gt; &lt;p&gt;WritableCellFormat cf2 = new WritableCellFormat(NumberFormats.FLOAT);&lt;/p&gt; &lt;p&gt;Number n = new Number(2,1,3.1415926535,cf2);&lt;/p&gt; &lt;p&gt;s.addCell(n);&lt;/p&gt; &lt;p&gt;n = new Number(2,2,-3.1415926535, cf2);&lt;/p&gt; &lt;p&gt;s.addCell(n);&lt;/p&gt; &lt;p&gt;/* Creates Label and writes float number upto 3 &lt;/p&gt; &lt;p&gt;decimal to one cell of sheet */&lt;/p&gt; &lt;p&gt;l = new Label(3,0,&amp;quot;3dps&amp;quot;,cf);&lt;/p&gt; &lt;p&gt;s.addCell(l);&lt;/p&gt; &lt;p&gt;NumberFormat dp3 = new NumberFormat(&amp;quot;#.###&amp;quot;);&lt;/p&gt; &lt;p&gt;WritableCellFormat dp3cell = new WritableCellFormat(dp3);&lt;/p&gt; &lt;p&gt;n = new Number(3,1,3.1415926535,dp3cell);&lt;/p&gt; &lt;p&gt;s.addCell(n);&lt;/p&gt; &lt;p&gt;/* Creates Label and adds 2 cells of sheet*/&lt;/p&gt; &lt;p&gt;l = new Label(4, 0, &amp;quot;Add 2 cells&amp;quot;,cf);&lt;/p&gt; &lt;p&gt;s.addCell(l);&lt;/p&gt; &lt;p&gt;n = new Number(4,1,10);&lt;/p&gt; &lt;p&gt;s.addCell(n);&lt;/p&gt; &lt;p&gt;n = new Number(4,2,16);&lt;/p&gt; &lt;p&gt;s.addCell(n);&lt;/p&gt; &lt;p&gt;Formula f = new Formula(4,3, &amp;quot;E1+E2&amp;quot;);&lt;/p&gt; &lt;p&gt;s.addCell(f);&lt;/p&gt; &lt;p&gt;/* Creates Label and multipies value of one cell of sheet by 2*/&lt;/p&gt; &lt;p&gt;l = new Label(5,0, &amp;quot;Multipy by 2&amp;quot;,cf);&lt;/p&gt; &lt;p&gt;s.addCell(l);&lt;/p&gt; &lt;p&gt;n = new Number(5,1,10);&lt;/p&gt; &lt;p&gt;s.addCell(n);&lt;/p&gt; &lt;p&gt;f = new Formula(5,2, &amp;quot;F1 * 3&amp;quot;);&lt;/p&gt; &lt;p&gt;s.addCell(f);&lt;/p&gt; &lt;p&gt;/* Creates Label and divide value of one cell of sheet by 2.5 */&lt;/p&gt; &lt;p&gt;l = new Label(6,0, &amp;quot;Divide&amp;quot;,cf);&lt;/p&gt; &lt;p&gt;s.addCell(l);&lt;/p&gt; &lt;p&gt;n = new Number(6,1, 12);&lt;/p&gt; &lt;p&gt;s.addCell(n);&lt;/p&gt; &lt;p&gt;f = new Formula(6,2, &amp;quot;F1/2.5&amp;quot;);&lt;/p&gt; &lt;p&gt;s.addCell(f);&lt;/p&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;private static void writeImageSheet(WritableSheet s) &lt;/p&gt; &lt;p&gt;throws WriteException&lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;p&gt;/* Creates Label and writes image to one cell of sheet*/ &lt;/p&gt; &lt;p&gt;Label l = new Label(0, 0, &amp;quot;Image&amp;quot;);&lt;/p&gt; &lt;p&gt;s.addCell(l);&lt;/p&gt; &lt;p&gt;WritableImage wi = new WritableImage(0, 3, 5, 7, new File(&amp;quot;image.png&amp;quot;));&lt;/p&gt; &lt;p&gt;s.addImage(wi);&lt;/p&gt; &lt;p&gt;/* Creates Label and writes hyperlink to one cell of sheet*/&lt;/p&gt; &lt;p&gt;l = new Label(0,15, &amp;quot;HYPERLINK&amp;quot;);&lt;/p&gt; &lt;p&gt;s.addCell(l);&lt;/p&gt; &lt;p&gt;Formula f = new Formula(1, 15, &lt;/p&gt; &lt;p&gt;&amp;quot;HYPERLINK(\&amp;quot;&lt;a href="http://www.andykhan.com/jexcelapi\"&gt;http://www.andykhan.com/jexcelapi\&lt;/a&gt;&amp;quot;, &amp;quot;+&lt;/p&gt; &lt;p&gt;&amp;quot;\&amp;quot;JExcelApi Home Page\&amp;quot;)&amp;quot;);&lt;/p&gt; &lt;p&gt;s.addCell(f);&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;}&lt;/p&gt;&lt;/font&gt; </description><link>http://coders-and-programmers-js.blogspot.com/2008/12/code-for-creating-and-writing-to-excel.html</link><author>noreply@blogger.com (Ravinderjeet S. Nagpal)</author><thr:total>0</thr:total></item></channel></rss>